{__NOLAYOUT__}
<layout name="no_nav" />

<section class="pr-pay">

  <h4 class="pr-pay-title">订单已经提交成功，请尽快支付</h4>

  <article class="pr-pay-content">
    <p class="pr-pay-content-item">订单编号：{$order.order_id}</p>
    <p class="pr-pay-content-item">收货人称：{$order.consignee}</p>
    <p class="pr-pay-content-item">手机号码：{$order.tel}</p>
    <p class="pr-pay-content-item">收货地址：{$order.address}</p>
    <p class="pr-pay-content-item">金额合计：<b>￥{$order['goods_amount']+$order['shipping_fee']}</b></p>  
  </article>

  <article class="pr-pay-way">
    <h5 class="pr-pay-way-title">请选择支付方式</h5>

    <form method="post" action="__CONTROLLER__/toPay">

      <ul id="pay-type" class="lists pr-pay-way-select">
        <li class="lists-item lists-item-link">
          <a>请选择支付方式</a>
        </li>
      </ul>

      <button class="btn btn-orange w100 pr-btn">立即付款</button>

      <input id="pay-type-hidden" type="hidden" name="apitype" value="">
      <input type="hidden" name="id" value="{$order.id}">
      <input type="hidden" name="sid" value="{$sid}">
      
    </form>
  </article>

</section>

<script type="text/javascript">
  $(function(){
    
    var payJSON = {$productPayApiJSON};
    var data = [
      [
        {text: "请选择支付方式", label: true}
      ], [
        {text: "取消", close:true}
      ]
    ];
    
    for(var i in payJSON) {

      var name = payJSON[i],
          value = i,
          tag = 1;

      tag && select( name, value );
      tag = 0;

      var fn = (function(name, value){
        return function(){
          select(name, value) 
        };
      })(name, value);

      data[0].push ({ text: name, close: true, click: fn});
    };

    $("#pay-type").on("tap", function() {
      require(["modal"], function(M) {
        M.actions( data );
      })
    });
    
    function select( text, value ){
      $("#pay-type-hidden").attr("value", value);
      $("#pay-type a").html(text);
    };
    
  });

</script>